<?php
declare (strict_types = 1);

namespace app\validate;

use think\Validate;

class Blog extends Validate
{
    protected $rule = [
        'title' => 'require|min:8|max:40',
        'category_id' => 'in:1,2,3,4',
        'content' => 'require|min:15'
    ];

    protected $message = [
        'title.require' => '标题不能为空',
        'title.min' => '标题最少8个字符',
        'title.max' => '标题最多40个字符',
        'category_id.in' => '请选择分类',
        'content.require' => '内容不能为空',
        'content.min' => '内容最少15个字'
    ];
}
